Repository navigation
fix(ValidationMessage): only set aria-invalid if danger color - #5149
Conversation
🦋 Changeset detectedLatest commit: d9e92a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
eirikbacker
left a comment
There was a problem hiding this comment.
Would prefer a fix of the logic rather than docs for a workaround 😌
|
Updated here, seems we already had the logic, but did not properly use it 🙈 |
Co-authored-by: Michael Marszalek <mimarz@gmail.com>
| const isInvalid = (el: Element) => el.getAttribute('data-color') !== 'success'; | ||
| const isInvalidColor = (el: Element) => { | ||
| const color = el.getAttribute('data-color'); | ||
| return !color || color === 'danger'; |
There was a problem hiding this comment.
Might be to early for me but is this first check correct? If no data-color is defined, then its an invalid color?
There was a problem hiding this comment.
Yes, default color of validation is danger, so no color = danger
There was a problem hiding this comment.
If no color is set, every data-field="validation" should make the input invalid
There was a problem hiding this comment.
yes, this is how it works now
Barsnes
left a comment
There was a problem hiding this comment.
Add some documentation to field and validationmessage, and I think this is good
Done |
Co-authored-by: Tobias Barsnes <tobiasbarsnes@gmail.com>
Summary
adds docs about #5140
Checks
pnpm changesetif relevant)